package cn.hd01.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.hd01.repository.entity.Cities;
import cn.hd01.service.CitiesService;
import cn.hd01.web.auth.Auth;

@Controller
@RequestMapping("/cities")
@Auth
public class CitiesController {
	
	@Autowired
	private CitiesService citiesService;
	
	@ResponseBody
	@RequestMapping(path = "/list/{provinceId}", method = RequestMethod.GET)
	private List<Cities> find(@PathVariable("provinceId") Integer provinceId) {
		return citiesService.findByProvinceId(provinceId);
	}

}
